package com.zhuss.car.car;

import com.zhuss.car.db.dao.ext.CarDao;
import com.zhuss.car.db.dao.ext.DriverDao;
import com.zhuss.circle.ICarService;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.exception.DzcxException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author summer
 * @date 2021/1/29 10:39
 */
@Component("carServiceImpl")
public class CarServiceImpl implements ICarService {

    @Autowired
    private CarDao carDao;

    @Autowired
    private DriverDao driverDao;

    @Override
    public Integer countCarByCompanyId(Long companyId) throws DzcxException {

        return carDao.countCarByCompanyId(companyId,StartStopEnum.启用.key());
    }

    @Override
    public Integer countDriverByCompanyId(Long companyId) throws DzcxException {

        return driverDao.countDriverByCompanyId(companyId, StartStopEnum.启用.key());
    }
}
